{\rtf1\ansi\ansicpg936\cocoartf1561\cocoasubrtf400
{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Menlo-Regular;\f2\fnil\fcharset134 PingFangSC-Regular;
\f3\fnil\fcharset0 Menlo-Italic;\f4\fnil\fcharset0 Menlo-BoldItalic;}
{\colortbl;\red255\green255\blue255;\red153\green168\blue186;\red32\green32\blue32;\red88\green118\blue71;
\red86\green132\blue173;\red191\green100\blue38;\red109\green109\blue109;\red133\green96\blue154;\red81\green136\blue67;
}
{\*\expandedcolortbl;;\csgenericrgb\c60000\c65882\c72941;\csgenericrgb\c12549\c12549\c12549;\csgenericrgb\c34510\c46275\c27843;
\csgenericrgb\c33725\c51765\c67843;\csgenericrgb\c74902\c39216\c14902;\csgenericrgb\c42745\c42745\c42745;\csgenericrgb\c52157\c37647\c60392;\csgenericrgb\c31765\c53333\c26275;
}
\paperw11900\paperh16840\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural\partightenfactor0

\f0\fs24 \cf0 z
\f1 \cf2 \cb3 apply \cf4 plugin\cf2 : \cf4 'com.android.application'\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0
\cf4 \
\cf2 buildscript \{\
    repositories \{\
        maven \{\
            url \cf4 "http://10.168.66.124:8084/nexus/content/groups/public/"\
        \cf2 \}\
        mavenCentral()\
        jcenter()\
    \}\
    dependencies \{\
        classpath \cf4 'com.android.tools.build:gradle:2.2.3'\
        \cf2 classpath \cf4 'org.aspectj:aspectjtools:1.8.9'\
    \cf2 \}\
\}\
allprojects \{\
    repositories \{\
        maven \{\
            url \cf4 "http://10.168.66.124:8084/nexus/content/groups/public/"\
        \cf2 \}\
    \}\
\}\
android \{\
    compileSdkVersion \cf5 23\
    \cf2 buildToolsVersion \cf4 '23.0.3'\
\
    \cf2 useLibrary \cf4 'org.apache.http.legacy'\
\
    \cf2 defaultConfig \{\
        minSdkVersion \cf5 16\
        \cf2 targetSdkVersion \cf5 23\
        \cf2 ndk \{\
            abiFilters \cf4 "armeabi"\cf2 , \cf4 'x86'\
        \cf2 \}\
        multiDexEnabled \cf6 true\
    \cf2 \}\
\
    signingConfigs \{\
        debug \{\
            \cf6 if \cf2 (isBuildOnServer()) \{\
                storeFile file(STORE_FILE_PATH)\
                storePassword STORE_PASSWORD\
                keyAlias KEY_ALIAS\
                keyPassword KEY_PASSWORD\
            \} \cf6 else \cf2 \{\
                \cf7 // 
\f2 \'b8\'f7\'d2\'b5\'ce\'f1\'cf\'df\'bf\'aa\'b7\'a2\'ca\'b1\'d7\'d4\'bc\'ba\'c9\'e8\'d6\'c3\'b5\'c4\'c7\'a9\'c3\'fb
\f1 \
                \cf2 storeFile file(\cf4 "./debug.keystore"\cf2 )\
                storePassword \cf4 "123456"\
                \cf2 keyAlias \cf4 "debug.keystore"\
                \cf2 keyPassword \cf4 "123456"\
            \cf2 \}\
        \}\
\
        release \{\
            \cf6 if \cf2 (isBuildOnServer()) \{\
                storeFile file(STORE_FILE_PATH)\
                storePassword STORE_PASSWORD\
                keyAlias KEY_ALIAS\
                keyPassword KEY_PASSWORD\
            \} \cf6 else \cf2 \{\
                \cf7 // 
\f2 \'b8\'f7\'d2\'b5\'ce\'f1\'cf\'df\'bf\'aa\'b7\'a2\'ca\'b1\'d7\'d4\'bc\'ba\'c9\'e8\'d6\'c3\'b5\'c4
\f1 release
\f2 \'c7\'a9\'c3\'fb
\f1 \
                \cf2 storeFile file(\cf4 "../wyy.keystore"\cf2 )\
                storePassword \cf4 "007wyy"\
                \cf2 keyAlias \cf4 "wyy"\
                \cf2 keyPassword \cf4 "007wyy"\
            \cf2 \}\
        \}\
    \}\
\
    buildTypes \{\
        debug \{\
            minifyEnabled \cf6 false\
            \cf2 zipAlignEnabled \cf6 true\
            \cf2 shrinkResources \cf6 false\
            \cf2 signingConfig \cf8 signingConfigs\cf2 .debug\
        \}\
\
        release \{\
            minifyEnabled \cf6 false\
            \cf2 zipAlignEnabled \cf6 true\
\
            \cf2 shrinkResources \cf6 false\
            \cf2 proguardFiles getDefaultProguardFile(\cf4 'proguard-android.txt'\cf2 ), \cf4 'proguard-rules.pro'\
            \cf2 signingConfig \cf8 signingConfigs\cf2 .release\
        \}\
    \}\
\
    lintOptions \{\
        abortOnError \cf6 false\
    \cf2 \}\
\
    dexOptions \{\
        incremental = \cf6 true\
        \cf2 preDexLibraries = \cf6 false\
        \cf2 javaMaxHeapSize \cf4 "4g"\
    \cf2 \}\
\
    packagingOptions \{\
        exclude \cf4 'META-INF/DEPENDENCIES.txt'\
        \cf2 exclude \cf4 'META-INF/LICENSE.txt'\
        \cf2 exclude \cf4 'META-INF/NOTICE.txt'\
        \cf2 exclude \cf4 'META-INF/NOTICE'\
        \cf2 exclude \cf4 'META-INF/LICENSE'\
        \cf2 exclude \cf4 'META-INF/DEPENDENCIES'\
        \cf2 exclude \cf4 'META-INF/notice.txt'\
        \cf2 exclude \cf4 'META-INF/license.txt'\
        \cf2 exclude \cf4 'META-INF/dependencies.txt'\
        \cf2 exclude \cf4 'META-INF/LGPL2.1'\
    \cf2 \}\
\
    \cf8 compileOptions\cf2 .with \{\
        sourceCompatibility JavaVersion.
\f3\i \cf8 VERSION_1_7\
        
\f1\i0 \cf2 targetCompatibility JavaVersion.
\f3\i \cf8 VERSION_1_7\
    
\f1\i0 \cf2 \}\
\
    \cf6 if\cf2 (isBuildOnServer()) \{\
        println(\cf4 "rename plugin apk"\cf2 )\
        \cf8 android\cf2 .\cf8 applicationVariants\cf2 .all \{ variant ->\
            variant.\cf8 outputs\cf2 .each \{ output ->\
                renameApk(\cf8 project\cf2 .getName(), variant, output)\
            \}\
        \}\
        println(\cf4 "add acdd resource id parameters"\cf2 )\
        aaptOptions \{\
            \cf6 if \cf2 (!readPluginId().equals(\cf4 ""\cf2 )) \{\
                additionalParameters \cf4 '--ACDD-resoure-id'\cf2 , readPluginId()\
            \}\
        \}\
\
    \}\
\}\
\
dependencies \{\
    \cf6 if \cf2 (isBuildSo()) \{\
        \cf7 // 
\f2 \'c9\'fa\'b3\'c9
\f1 so
\f2 \'cb\'f9\'d0\'e8\'c2\'df\'bc\'ad
\f1 \
        \cf2 provided files(AUTOHOME_LIB_PATH)\
    \} \cf6 else \cf2 \{\
        \cf7 // 
\f2 \'d5\'fd\'b3\'a3\'c2\'df\'bc\'ad
\f1 \
        \cf2 compile \cf4 group\cf2 :\cf4 'com.autohome.autohomelib'\cf2 , \cf4 name\cf2 :\cf4 'autohomelib'\cf2 , \cf4 version\cf2 :\cf4 '9.5.5-SNAPSHOT'\cf2 , \cf4 changing\cf2 :\cf6 true\
\cf7 //        compile project(':autohomelib')\
        \cf2 compile (\cf4 group\cf2 : \cf4 'com.autohome.localpush'\cf2 , \cf4 name\cf2 : \cf4 'ahlocalpush'\cf2 , \cf4 version\cf2 : \cf4 '1.0.5-SNAPSHOT'\cf2 , \cf4 changing\cf2 :\cf6 true\cf2 )\{\
            exclude \cf4 group\cf2 :\cf4 'com.autohome.autohomelib'\cf2 , \cf4 module\cf2 :\cf4 'autohomelib'\
        \cf2 \}\
    \}\
    compile fileTree(\cf4 dir\cf2 : \cf4 'libs'\cf2 , \cf4 include\cf2 : \cf4 '*.jar'\cf2 )\
    compile \cf4 'com.android.support:multidex:1.0.1'\
\cf2 \}\
\
\cf8 configurations\cf2 .all \{\
    resolutionStrategy.cacheChangingModulesFor \cf5 0\cf2 , \cf4 'seconds'\
\cf2 \}\
\

\f3\i \cf9 /**\
 * 
\f2\i0 \'ca\'c7\'b7\'f1\'b2\'e5\'bc\'fe
\f3\i so
\f2\i0 \'b4\'f2\'b0\'fc
\f3\i \
 * 
\f4\b @return\
 
\f3\b0 */\

\f1\i0 \cf6 def \cf2 isBuildSo() \{\
    \cf6 if \cf2 (isPropertyTrue(\cf4 'PLUGIN_BUILD_SO'\cf2 )) \{\
        println(\cf4 "build plugin so"\cf2 )\
        \cf6 return true\
    \cf2 \} \cf6 else \cf2 \{\
        println(\cf4 "build plugin apk"\cf2 )\
        \cf6 return false\cf2 ;\
    \}\
\}\
\

\f3\i \cf9 /**\
 * 
\f2\i0 \'ca\'c7\'b7\'f1\'b7\'fe\'ce\'f1\'c6\'f7\'b4\'f2\'b0\'fc\'c4\'a3\'ca\'bd
\f3\i \
 * 
\f4\b @return\
 
\f3\b0 */\

\f1\i0 \cf6 def \cf2 isBuildOnServer() \{\
    \cf6 if \cf2 (isPropertyTrue(\cf4 'PLUGIN_BUILD_SERVER'\cf2 )) \{\
        println(\cf4 "build plugin on server"\cf2 )\
        \cf6 return true\
    \cf2 \} \cf6 else \cf2 \{\
        println(\cf4 "build plugin on client"\cf2 )\
        \cf6 return false\cf2 ;\
    \}\
\}\
\

\f3\i \cf9 /**\
 *\
 * 
\f4\b @param 
\f3\b0 propertyKey\
 * 
\f4\b @return\
 
\f3\b0 */\

\f1\i0 \cf6 def \cf2 isPropertyTrue(String propertyKey) \{\
    \cf6 return \cf2 propertyKey != \cf6 null \cf2 && !propertyKey.isEmpty() &&\
            \cf8 rootProject\cf2 .hasProperty(propertyKey) && \cf8 rootProject\cf2 .property(propertyKey).equals(\cf4 'true'\cf2 )\
\}\
\

\f3\i \cf9 /**\
 * 
\f2\i0 \'b6\'c1\'c8\'a1\'b2\'e5\'bc\'fe
\f3\i id
\f2\i0 \'b1\'e0\'ba\'c5
\f3\i \
 * 
\f4\b @return\
 
\f3\b0 */\

\f1\i0 \cf6 def \cf2 readPluginId() \{\
    String versionName;\
    String configVersionName = \cf8 android\cf2 .\cf8 defaultConfig\cf2 .\cf8 versionName\
    \cf6 if \cf2 (configVersionName != \cf6 null \cf2 && configVersionName.contains(\cf4 "0x"\cf2 )) \{\
        versionName = configVersionName;\
    \} \cf6 else \cf2 \{\
        \cf6 def \cf2 manifest = \cf6 new \cf2 XmlSlurper().parse(file(\cf4 "src/main/AndroidManifest.xml"\cf2 ))\
        versionName = manifest[\cf4 '@android:versionName'\cf2 ]\
    \}\
    println(\cf4 "build versionName: " \cf2 + versionName)\
    \cf6 def \cf2 index = versionName.lastIndexOf(\cf4 "0x"\cf2 )\
    \cf6 def \cf2 pluginId = \cf4 ""\
    \cf6 if \cf2 (index > \cf5 0\cf2 ) \{\
        pluginId = versionName.substring(index)\
    \}\
    println(\cf4 "build pluginId: " \cf2 + pluginId)\
    \cf6 return \cf2 pluginId\
\}\
\
\
\cf6 import \cf2 org.aspectj.bridge.IMessage\
\cf6 import \cf2 org.aspectj.bridge.MessageHandler\
\cf6 import \cf2 org.aspectj.tools.ajc.Main\
\
\cf8 project\cf2 .android.applicationVariants.all \{ variant ->\
    JavaCompile javaCompile = variant.javaCompile\
    javaCompile.doLast \{\
        String[] args = [\cf4 "-showWeaveInfo"\cf2 ,\
                         \cf4 "-1.5"\cf2 ,\
                         \cf4 "-inpath"\cf2 , javaCompile.\cf8 destinationDir\cf2 .toString(),\
                         \cf4 "-aspectpath"\cf2 , javaCompile.\cf8 classpath\cf2 .\cf8 asPath\cf2 ,\
                         \cf4 "-d"\cf2 , javaCompile.\cf8 destinationDir\cf2 .toString(),\
                         \cf4 "-classpath"\cf2 , javaCompile.\cf8 classpath\cf2 .\cf8 asPath\cf2 ,\
                         \cf4 "-bootclasspath"\cf2 , \cf8 project\cf2 .android.bootClasspath.join(File.
\f3\i \cf8 pathSeparator
\f1\i0 \cf2 )]\
\
        MessageHandler handler = \cf6 new \cf2 MessageHandler(\cf6 true\cf2 );\
        \cf6 new \cf2 Main().run(args, handler)\
\
        \cf6 def \cf2 log = \cf8 project\cf2 .\cf8 logger\
        \cf6 for \cf2 (IMessage message : handler.getMessages(\cf6 null\cf2 , \cf6 true\cf2 )) \{\
            \cf6 switch \cf2 (message.getKind()) \{\
                \cf6 case \cf2 IMessage.
\f3\i \cf8 ABORT
\f1\i0 \cf2 :\
                \cf6 case \cf2 IMessage.
\f3\i \cf8 ERROR
\f1\i0 \cf2 :\
                \cf6 case \cf2 IMessage.
\f3\i \cf8 FAIL
\f1\i0 \cf2 :\
                    log.error message.\cf8 message\cf2 , message.\cf8 thrown\
                    \cf6 break\cf2 ;\
                \cf6 case \cf2 IMessage.
\f3\i \cf8 WARNING
\f1\i0 \cf2 :\
                \cf6 case \cf2 IMessage.
\f3\i \cf8 INFO
\f1\i0 \cf2 :\
                    log.info message.\cf8 message\cf2 , message.\cf8 thrown\
                    \cf6 break\cf2 ;\
                \cf6 case \cf2 IMessage.
\f3\i \cf8 DEBUG
\f1\i0 \cf2 :\
                    log.debug message.\cf8 message\cf2 , message.\cf8 thrown\
                    \cf6 break\cf2 ;\
            \}\
        \}\
    idddddd\}\
